package com.yanqu.road.server.cmd.union.cross;

import com.yanqu.road.pb.union.UnionProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.S_UNION_SEARCH, desc = "查找商会")
public class SearchUnionCmd extends AbstractCommand {

	private long unionAliasId;

	@Override
	public boolean parseData(YanQuMessage packet) throws Exception {
		UnionProto.UnionSearchReqMsg reqMsg = UnionProto.UnionSearchReqMsg.parseFrom(packet.getBytes());
		unionAliasId = reqMsg.getUnionAliasId();
		return true;
	}

	@Override
	public void execute(GamePlayer player, YanQuMessage packet) throws Exception {

		player.sendPacket(Protocol.C_UNION_SEARCH, UnionProto.UnionSearchReqMsg.newBuilder().setUnionAliasId(unionAliasId));

	}

	@Override
	public void sendData(GamePlayer player) {

	}

}
